<div class="box_right">	
	
	
<h1>
	商户信息
</h1>

<div class="pro_box layui-form">
	<div class="des">
		<div class="left">
			<p>商户名称：<?php echo $gasstation->gasstation_name; ?></p>
			<p>注册地址：<?php echo $gasstation->address; ?></p>
			<p>营业执照注册号：暂无</p>
			<p>开户支行：暂无</p>
			<p>银行账号：暂无</p>
			<p>结算费率：暂无</p>
		</div>
		<div class="right"> 
			<img src="<?php if (isset($gasstation->yy_zhizhao)&&$gasstation->yy_zhizhao!=''){echo $gasstation->yy_zhizhao;}else{ echo base_url().'themes/gasstation/images/9.png';}?>" style="width: 200px;" />
		</div>
		<div class="clear"></div>
	</div>
</div>

	<div class="pro_box layui-form">
	  <div class="order_list">
	  	<div class="layui-row">
	  		<div class="layui-col-xs4">
	  			<h2 class="order_list_h">用户</h2>
	  		</div>
	  		<div class="layui-col-xs1 layui-col-xs-offset7">
	  			<?php if (in_array('gasstation/systems/add_user', $_SESSION['GASSTATION_ACL_ARR'])){?>
            	<a class="btn_get" style="background: #F18101;" href="<?php echo base_url()."gasstation/systems/add_user"?>"><i class="icon-copy"></i>新增</a>
            	<?php }?>
	  		</div>
	  	</div>
	  	<form action="<?php echo base_url()."gasstation/systems/del_some_user"?>" method="post" id="delForm">
		<table class="layui-table ct" lay-skin="line">
		  <thead>
			<tr>
				<th>选择</th>
				<th>姓名</th>
				<th>手机号</th>
				<th>角色权限</th>
				<th>新增时间</th>
				<th>操作</th>
			</tr>
		  </thead>
		  <tbody>
		  
		  <?php if (isset($result)&&count($result)>0){?>
		  <?php if ($page_num == 1||$page_num ==''){?>
		      <tr>
				<td></td>
				<td><?php echo $res->user_name;?></td>
                <td><?php echo $res->user_phone;?></td>
                <td><?php if (isset($res->role_id)&&$res->role_id!='')echo '超级管理员';else echo '普通用户';?></td>
                <td><?php echo $res->createtime;?></td>
				<td></td>
			</tr>
		  <?php }}?>
		  	<?php if (isset($result)&&count($result)>0){
					foreach ($result as $user){
			?>
			<tr>
				<td><input type="checkbox" name="num[]" value="<?php echo $user->id;?>" title="" lay-skin="primary" ></td>
				<td><?php echo $user->user_name;?></td>
                <td><?php echo $user->user_phone;?></td>
                <td><?php if (isset($user->role_id)&&$user->role_id!='')echo '超级管理员';else echo '普通用户';?></td>
                <td><?php echo $user->createtime;?></td>
				<td>                          
					<?php if (in_array('gasstation/systems/edit_user', $_SESSION['GASSTATION_ACL_ARR'])){?>
					<a class="btn btn-sm btn-info" href="<?php echo base_url().'gasstation/systems/edit_user/'.$user->id;?>"><i class="icon-edit"></i>编辑</a>
					<?php }?>
					<?php if (in_array('gasstation/systems/del_user', $_SESSION['GASSTATION_ACL_ARR'])){?>
                    <a href="javascript:void(0)" onclick="delmodal('<?php echo $user->id;?>')" data-toggle="modal" class="btn btn-danger btn-sm"><i class="icon-trash"></i>删除</a>
                    <?php }?>
				</td>
			</tr>
			<?php }
            }else{?>
			<tr>
				<td colspan="12">无数据</td>
			</tr>
			<?php }?>
		  </tbody>
		</table>
		</form>
		<input type="checkbox" name="" title="全选" lay-skin="primary" >
		<?php if (in_array('gasstation/systems/del_some_user', $_SESSION['GASSTATION_ACL_ARR'])){?>
		<button onclick="delSomeModal()" style="padding: 0px 20px;">批量删除账号</button>
		<?php }?>
	  </div>
	  <div class="col-sm-12">
		<div class="modal-footer no-margin-top">
			<div class="pull-left record">
				共<?php echo $count;?>条记录
				</div>
            	<?php if (isset($page))echo $page;?>
		</div>
	  </div> 
	</div>
</div>
<div id="delModal" class="modal fade" role="dialog" aria-hidden="true">
	<div class="modal-dialog" style="width: 300px">
		<div class="modal-content">
			<div class="modal-header">
			  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			  <h3>提示信息</h3>
			</div>
			<div class="modal-body">
			  <p>确定要删除该用户吗？</p>
			</div>
			<div class="modal-footer">
			  <a id="delbtn" href="#" class="btn btn-danger">确定</a>
			  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
			</div>
		</div>
	</div>
</div>

<div id="delsomeModal" class="modal fade" role="dialog" aria-hidden="true">
	<div class="modal-dialog" style="width: 300px">
		<div class="modal-content">
			<div class="modal-header">
			  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
			  <h3>提示信息</h3>
			</div>
			<div class="modal-body">
			  <p>确定要删除所选用户吗？</p>
			</div>
			<div class="modal-footer">
			  <button id="delsomebtn" type="submit" class="btn btn-danger">确定</button>
			  <a href="#" class="btn btn-info" data-dismiss="modal" aria-hidden="true">取消</a>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
function delmodal(id){
	$("#delbtn").attr('href','<?php echo base_url().'gasstation/systems/del_user/'?>'+id);
    $('#delModal').modal('show');
}

function delSomeModal(){
	if(checkSelect()){
    	$('#delsomeModal').modal('show');
	}else{
		alert('请选择正确的记录进行删除');
	}
}
$("#delsomebtn").click(function(){
	$("#delForm").submit();
});

</script>
<script>
//Demo
layui.use(['form','element','laydate'], function(){
  var form = layui.form,
  	element = layui.element,
  	laydate = layui.laydate;

  //时间选择器
  laydate.render({
    elem: '#test5'
    ,type: 'datetime'
  });
    //时间选择器
  laydate.render({
    elem: '#test6'
    ,type: 'datetime'
  }); 
  
  //监听提交
  form.on('submit(formDemo)', function(data){
    layer.msg(JSON.stringify(data.field));
    return false;
  });
});
$('input[name="selectall"]').click(function(){  
    //alert(this.checked);  
    if($(this).is(':checked')){  
        $('input[name="stuCheckBox"]').each(function(){  
            //此处如果用attr，会出现第三次失效的情况  
            $(this).prop("checked",true);  
        });  
}else{  
    $('input[name="stuCheckBox"]').each(function(){  
            $(this).removeAttr("checked",false);  
        });  
        //$(this).removeAttr("checked");  
}  
      
});  
</script>